/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("ware_outwarehousebill",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using VOL.Warehouse.IServices;
using VOL.Warehouse.IRepositories;
using Microsoft.EntityFrameworkCore;

namespace VOL.Warehouse.Controllers
{
    public partial class ware_outwarehousebillController
    {
        private readonly Iware_outwarehousebillService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly Iware_outwarehousebilllistRepository _ware_outwarehousebilllistRepository;

        [ActivatorUtilitiesConstructor]
        public ware_outwarehousebillController(
            Iware_outwarehousebillService service,
            IHttpContextAccessor httpContextAccessor,
            Iware_outwarehousebilllistRepository ware_outwarehousebilllistRepository
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _ware_outwarehousebilllistRepository = ware_outwarehousebilllistRepository;
        }

        [Route("getDetailRows"), HttpGet]
        public async Task<IActionResult> GetDetailRows(int OutWareHouseBill_Id)
        {
            var rows = await _ware_outwarehousebilllistRepository.FindAsIQueryable(x => x.OutWareHouseBill_Id == OutWareHouseBill_Id).ToListAsync();
            return JsonNormal(rows);

        }
    }
}
